-- GENERATED SPELL FOR [Royal Dreadguard] --


function spell0_13839(pUnit, Event) --@Hamstring,n/a--
pUnit:FullCastSpellOnTarget(9080,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_13839', 10327, 1)
end

function spell1_13839(pUnit, Event) --@Shield Bash,n/a--
pUnit:FullCastSpellOnTarget(11972,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_13839', 8349, 1)
end

function spell2_13839(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(16100,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_13839', 630, 1)
end

function spell3_13839(pUnit, Event) --@Strike,n/a--
pUnit:FullCastSpellOnTarget(14516,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_13839', 603, 1)
end

function Sorts_13839(pUnit, Event)
local choix_sorts_13839 = math.random(0, 3)
if choix_sorts_13839 == 0 then
pUnit:RegisterEvent('spell0_13839', 1, 1)
end
if choix_sorts_13839 == 1 then
pUnit:RegisterEvent('spell1_13839', 1, 1)
end
if choix_sorts_13839 == 2 then
pUnit:RegisterEvent('spell2_13839', 1, 1)
end
if choix_sorts_13839 == 3 then
pUnit:RegisterEvent('spell3_13839', 1, 1)
end
end

function mob13839_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_13839', math.random(1500, 3000), 1)
end

function mob13839_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob13839_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob13839_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(13839, 1, 'mob13839_Action')
RegisterUnitEvent(13839, 2, 'mob13839_Leave')
RegisterUnitEvent(13839, 3, 'mob13839_Kill')
RegisterUnitEvent(13839, 4, 'mob13839_Die')
